from PyQt4.QtGui import *
from PyQt4.QtCore import *
import sys
from sqlite import TestWidget

class MainWidget(QWidget):
    def __init__(self,parent = None):
        super(MainWidget,self).__init__(parent)
        
        self.testWidget = TestWidget(self)
        self.testWidget.createConnection()
        
        #self.testWidget.addData()
        #self.testWidget.addData("insert into t1(f2) values('user')")
        self.testWidget.runSql("update t1 set f4 = 100 where f2 = 'jane' ")
        self.testWidget.runSql("select f2 from t1 order by f4 desc")
        #self.usernamesql = "name"
        #self.passwordsql = "password"
        #stringSql = "insert into t1(f2,f3) values('" + self.usernamesql + "','" + self.passwordsql + "')"
        #print stringSql
        print self.testWidget.list
        #print self.testWidget.list[0]
        #print self.testWidget.list[1]
        
        
        
a=QApplication(sys.argv)  
w=MainWidget() 
w.show() 
a.exec_()